<template>
    <div class="background">
        <el-container class="login-container">
            <el-header>
                <h1>驻车</h1>
            </el-header>
            <el-main>
                <el-form :model="form" @submit.prevent="handleLogin">
                    <el-form-item label="账号">
                        <el-input v-model="form.username" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="密码">
                        <el-input type="password" v-model="form.password" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="确认密码">
                        <el-input v-model="form.passwordAS" autocomplete="off"></el-input>
                    </el-form-item>

                    <el-form-item class="form_buttons">
                        <el-button type="primary" @click="handleRegister">注册</el-button>
                    </el-form-item>

                </el-form>
            </el-main>
        </el-container>
    </div>

</template>

<script>
import { onMounted, ref } from 'vue';

export default {
    setup() {
        const codeUrl = ref('')
        const form = ref({
            username: '',
            password: '',
            passwordAS:''
        });



        const handleRegister = async () => {
            console.log('注册')
            if(password !== passwordAS){
                alert('两次密码输入不一致')
            }else{

            }
        }





        return {
            form,
            handleRegister,
        };
    }
};
</script>

<style scoped>
body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
}

.background {
    background-image: url('../assets/img/bg.png');
    background-size: cover;
    background-position: center;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    height: 45%;
    text-align: center;
}

.login-container h1 {
    margin-bottom: 20px;
}

.login-container form {
    display: flex;
    flex-direction: column;
}

.login-container .el-input {
    margin-bottom: 0px;
    padding: 0px;
}

.login-container .form_buttons {
    padding-left: 130px;
    padding-top: 0px;
    color: white;
    border: none;
    border-radius: 4px;
    justify-content: space-between;
}

.login-container button:hover {
    background-color: #66b1ff;
}

.login-container .form_code{
    display: flex;
}

.login-container .form_code img{
    height: 10%;
}

.login-container .form_code .el-input{
}
</style>
